#pragma once
#include <qbprotocol/include/SSFilters.h>
#include <QString>

typedef struct _FilterCondition
{
	BLHCONDITION	stBlh;
	int				nSearchType;// 0 = bondcode, 1 = bondkey
	QString			strSearch;
	int				m_nFocusType;//0 普通筛选 1 方案筛选 2 关注组筛选
	QString			strGroupID;
	bool			bNeedFilter;	//BLHCONDITION是否参与过滤
	_FilterCondition()
	{
		bNeedFilter = true;
		nSearchType = 0;
		strSearch = "";
		m_nFocusType = 0;
		strGroupID = "";
	}

	bool operator ==(const _FilterCondition& stFC)
	{
		if (stFC.bNeedFilter != bNeedFilter)return false;
		if (stFC.nSearchType != nSearchType)return false;
		if (stFC.strSearch != strSearch) return false;
		if (stFC.m_nFocusType != m_nFocusType) return false;
		if (stFC.m_nFocusType == m_nFocusType && m_nFocusType == 2)
		{
			if (strGroupID != stFC.strGroupID)
				return false;
		}
		if ((blh_condition_str)stFC.stBlh == stBlh) return true;
		else return false;
	}
}FilterCondition;


class FilterInterface
{
public:
	virtual	bool SetBlh(const BLHCONDITION& blh) = 0;
	virtual	void GetBlh(BLHCONDITION& blh) = 0;
};